package com.voole.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController {

	private static Logger logger = Logger.getLogger(IndexController.class);
	
	@RequestMapping("login.do")
	public ModelAndView login(HttpServletRequest request,HttpServletResponse response) {
		ModelAndView next = new ModelAndView("login");
		String error = request.getParameter("error");
		if("".equals(error)){
			next.addObject("errorInfo", "登陆失败，请稍后再试");
		}
		return next;
	}
	
	@RequestMapping("index.do")
    public ModelAndView index(HttpServletRequest request,HttpServletResponse response) {
        String errorInfo = null;
		try {
        	//跳转到 主页面
		} catch (Exception e) {
			errorInfo = e.getMessage();
		}
		return new ModelAndView("index");
    }
	
	@RequestMapping("blank.do")
    public ModelAndView blank(HttpServletRequest request,HttpServletResponse response) {
		return new ModelAndView("page_blank");
    }
}
